<%@ page contentType="text/html; charset=utf-8" language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ page import="java.net.URLDecoder" %>
<%@ page import="java.net.URLEncoder" %>
<html>

	<title>luanmad ajax dtree deom--update</title>

	<SCRIPT type="text/javascript" src="javascript/colorPicker.js"></SCRIPT>
	<SCRIPT type="text/javascript" src="javascript/styleEditor.js"></SCRIPT>
	<script type="text/javascript" src="javascript/util.js"></script>
	<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>

	<script language="JavaScript">
       

    function check_submit() {
        var regu = /^[0-9]+$/;
        var re = new RegExp(regu);
        var nodeName = document.getElementById("nodeName");
        var nodeUrl = document.getElementById("nodeUrl");
        nodeName.value=encodeURI(nodeName.value,"utf-8");
        if (trim(nodeName.value) == "") 
        {
            alert("请输入类别名称");
            return false;
        }
        if(trim(nodeUrl.value) == "")
        {
             alert("请输入链接地址");
            return false;
        }

        //nodeOperate_add();
        return true;
    }

</script>

	<body>
		<table border="1" align="center" cellpadding="0" cellspacing="0">
			<tr>
				<td width="750" align="center" valign="top">
					<br>

					<table cellpadding="0" cellspacing="0" class="no-print" width="750">
						<tr>
							<td height="291" align="right" valign="top">
								<table width="99%" border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td width="94%" background="/StoreAdmin/images/lbg1.jpg"
											class="c14">&nbsp;
											
										</td>

									</tr>
									<tr>
										<td height="229" colspan="3" align="center" valign="top"
											bgcolor="#E4E4E4">
											<table width="98%" border="0" cellspacing="0" cellpadding="0">
												<s:form action="treeNodesUpdate.action"
													onsubmit="return check_submit()" name="theform"
													theme="simple">

                                                     <!-- 防止刷新重复提交-->
                                                    <s:token></s:token>
													<tr>
														<td height="25">
															修改类别
														</td>
													</tr>
													<tr>
														<td height="174" valign="top" bgcolor="#FFFFFF">
															<table cellspacing="0" cellpadding="3" border="0">
																<tr>
																	<td width="125">
																		<label>
																			类别名:
																		</label>
																		<span class="required">*</span>
																	</td>
																	<td colspan="2">
																		<% 
																		String currentNodeName = request.getParameter("treeNodes.name");
																		 
																		%> 
																		<!-- decode the currentNodeName which encode with utf-8  -->
																		<% 
																		   String decodeCurrentNodeName = URLDecoder.decode(URLDecoder.decode(currentNodeName, "utf-8"),"utf-8");
																		%>
																		<s:hidden name="treeNodes.id" value="%{#parameters['treeNodes.id']}" />
																		<s:textfield id="nodeName" name="treeNodes.name" value="<%=decodeCurrentNodeName %>" />
																		

																	</td>
																		<td with="200">
																	    <label>URL地址：</label>
																	    <span class="required">*</span>
																	</td>
																	<td width="1" colspan="4">
																	  <s:textfield name="treeNodes.url" id="nodeUrl" maxlength="200" value="%{#parameters['treeNodes.url']}" />

																	</td>
															  </tr>

																<tr>
																	<td height="20" width="125">
																		<label>
																			类别字体样式:
																			<span class="required"></span>:
																		</label>
																	</td>
																	<TD width="100" bgcolor="#FFFFFF" style="WIDTH: 100px">
																		<s:select label="类别字体样式"
																			onchange="applyFont('example-2', this.options[this.selectedIndex].text);"
																			list="#{'字体类型':';','Arial':'font-family:Arial,Helvetica,sans-serif;','Garamond':'font-family:Garamond;','Tahoma':'font-family:Tahoma;','Verdana':'font-family:Verdana;'}"
																			listKey="value" listValue="key" value="---select----"
																			name="style.fontType" id="style.fontType" theme="simple" />
																  </TD>
																	<TD width="95" bgcolor="#FFFFFF" style="WIDTH: 95px">
																		<s:select label="字体大小"
																			onchange="applyFontSize('example-2', this.options[this.selectedIndex].text);"
																			list="#{'字体大小':';','10px':'font-size:10px;','14px':'font-size:14px','20px':'font-size:20px'}"
																			listKey="value" listValue="key" value="---select----"
																			name="style.fontSize" id="style.fontSize" theme="simple" />
																  </TD>
																	<TD width="95" bgcolor="#FFFFFF" style="WIDTH: 95px">
																		<s:select label="字体样式"
																			onchange="applyFontStyle('example-2', this.options[this.selectedIndex].text);"
																			list="#{'字体样式':';','BOLD':'font-weight:bold;','ITALIC':'font-style:italic;','NORMAL':'font-style:normal;'}"
																			listKey="value" listValue="key" value="---select----"
																			name="style.fontStyle" id="style.fontStyle" theme="simple" />
																  </TD>
																  <TD width="171" bgcolor="#FFFFFF" style="WIDTH: 90px">
																	<s:textfield 
																		id="style.fontColor" name="style.fontColor"
																		onclick="applyFontColor('example-2', this.value);"
																		onfocus="applyFontColor('example-2', this.value);"
																		onblur="relateColor(this.id,'colorLayout');"
																		onmouseup="applyFontColor('example-2', this.value);"
																		onkeypress="return blockInvalid(this,event);"
																		onkeyup="relateColor(this.id,'colorLayout');applyFontColor('example-2', this.value);"
																		value="#000000" size="5" maxLength="7" theme="simple"  />
																	<span id="colorLayout"
																		style="BORDER-RIGHT: #000 1px solid; BORDER-TOP: #000 1px solid; FLOAT: left; MARGIN-LEFT: 2px; BORDER-LEFT: #000 1px solid; WIDTH: 19px; BORDER-BOTTOM: #000 1px solid; HEIGHT: 19px; TEXT-DECORATION: none"
																		onclick="pickColor(this.id,'style.fontColor');">
																    </span>	
																   													
															      </TD>
<td><DIV id="example-2">
																		example		
																	</DIV>		</td>
														      </tr>

									

																<tr>

																	<td width="125">
																		<span>所属分类:</span>
																	</td>
																	<td colspan="4">
																		<s:select label="所属分类" 
																		    headerKey="0" headerValue="主分类"
																		    list="parentNodesList"
																			listKey="id" listValue="name" value="${param['treeNodes.pid']}"
																			name="treeNodes.pid" theme="simple" />
																	</td>
																	<td colspan="4">
																		<s:hidden name="treeNodes.sort" value="%{#parameters['treeNodes.sort']}" />
																	</td>

																</tr>
															</table>
															<div style="margin-top: 10px;">
																<span class="important">带*为必填项</span>
															</div>
														</td>

													</tr>
													<tr>
														<td height="30" valign="bottom">
															<s:submit name="submit" label="确定" />
															&nbsp;&nbsp;&nbsp;&nbsp;

															<s:reset name="return" label="取消并返回" onclick="hideDiv()" />

														</td>
													</tr>
												</s:form>
											</table>
										</td>
									</tr>
									<tr>
									
									</tr>
								</table>
							</td>
						</tr>
					</table>
					<br>

				</td>
			</tr>
		</table>
	</body>
</html>
